<template>
	<div class="app-container">
		<el-row v-if="
        queryType == 1 || queryType == 2 || queryType == 3 || queryType == 4
      ">
			<el-col style="margin-bottom: 5px; align-items: center; display: flex">
				<el-tag type="warning" style="cursor: pointer" @click="changeTypeQuery(1)">管点资产汇总表</el-tag>
				<el-icon @click="chageQueryType1" v-if="!showqueryType1" style="margin-left: 10px; cursor: pointer">
					<ArrowRight />
				</el-icon>
				<el-icon @click="chageQueryType1" style="margin-left: 10px; cursor: pointer" v-if="showqueryType1">
					<ArrowDown />
				</el-icon>
			</el-col>
			<el-col :span="3" v-for="item in pointData" style="margin-bottom: 5px" v-if="showqueryType1">
				<el-tag style="cursor: pointer"
					@click="changeTypeQuery(2, item.className, item.classId)">{{ item.className }}</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="
        queryType == 1 || queryType == 2 || queryType == 3 || queryType == 4
      ">
			<el-col style="margin-bottom: 5px; align-items: center; display: flex">
				<el-tag type="warning" style="cursor: pointer" @click="changeTypeQuery(3)">管段资产汇总表</el-tag>
				<el-icon @click="chageQueryType2" v-if="!showqueryType2" style="margin-left: 10px; cursor: pointer">
					<ArrowRight />
				</el-icon>
				<el-icon @click="chageQueryType2" style="margin-left: 10px; cursor: pointer" v-if="showqueryType2">
					<ArrowDown />
				</el-icon>
			</el-col>
			<el-col :span="3" v-for="item in lineData" style="margin-bottom: 5px" v-if="showqueryType2">
				<el-tag style="cursor: pointer"
					@click="changeTypeQuery(4, item.className, item.classId)">{{ item.className }}</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="queryType == 5 || queryType == 6">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(5)">管网在线监测</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="queryType == 5 || queryType == 6">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(6)">管网异常数据监测</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="queryType == 7 || queryType == 8">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(7)">设备在线检测</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="queryType == 7 || queryType == 8">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(8)">设备异常上报</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="queryType == 9 || queryType == 10 || queryType == 11">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(9)">今日巡检计划清单</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="queryType == 9 || queryType == 10 || queryType == 11">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(10)">月度巡检计划清单</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="queryType == 9 || queryType == 10 || queryType == 11">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(11)">年度巡检计划清单</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="
        queryType == 12 || queryType == 13 || queryType == 14 || queryType == 15
      ">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(12)">月度巡检计划分析</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="
        queryType == 12 || queryType == 13 || queryType == 14 || queryType == 15
      ">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(13)">年度巡检计划分析</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="
        queryType == 12 || queryType == 13 || queryType == 14 || queryType == 15
      ">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(14)">巡检人员月度情况分析</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="
        queryType == 12 || queryType == 13 || queryType == 14 || queryType == 15
      ">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(15)">巡检人员年度情况分析</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="
        queryType == 16 || queryType == 17 || queryType == 18 || queryType == 19
      ">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(16)">月度隐患上报清单</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="
        queryType == 16 || queryType == 17 || queryType == 18 || queryType == 19
      ">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(17)">年度隐患上报清单</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="
        queryType == 16 || queryType == 17 || queryType == 18 || queryType == 19
      ">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(18)">月度隐患上报分析</el-tag>
			</el-col>
		</el-row>
		<el-row v-if="
        queryType == 16 || queryType == 17 || queryType == 18 || queryType == 19
      ">
			<el-col style="margin-bottom: 5px">
				<el-tag style="cursor: pointer" @click="changeTypeQuery(19)">年度隐患上报分析</el-tag>
			</el-col>
		</el-row>
		<div class="printContent">
			<el-card shadow="never">
				<div class="search-container">
					<img src="../../assets/images/maobao_logo.png" alt="" />
					<span v-if="queryType == 1">管点资产汇总表</span>
					<span v-if="queryType == 2">{{ queryName }}</span>
					<span v-if="queryType == 3">管段资产汇总表</span>
					<span v-if="queryType == 4">{{ queryName }}</span>
					<span v-if="queryType == 5">管网在线监测</span>
					<span v-if="queryType == 6">管网异常数据监测</span>
					<span v-if="queryType == 7">设备在线监测</span>
					<span v-if="queryType == 8">设备异常上报</span>
					<span v-if="queryType == 9">今日巡检计划清单</span>
					<span v-if="queryType == 10">月度巡检计划清单</span>
					<span v-if="queryType == 11">年度巡检计划清单</span>
					<span v-if="queryType == 12">月度巡检计划分析</span>
					<span v-if="queryType == 13">年度巡检计划分析</span>
					<span v-if="queryType == 14">巡检人员月度情况分析</span>
					<span v-if="queryType == 15">巡检人员年度情况分析</span>
					<span v-if="queryType == 16">月度隐患上报清单</span>
					<span v-if="queryType == 17">年度隐患上报清单</span>
					<span v-if="queryType == 18">月度隐患上报分析</span>
					<span v-if="queryType == 19">年度隐患上报分析</span>
				</div>
			</el-card>
			<!-- 	<el-form :model="formData" v-if="queryType == 3 || queryType == 4">
          <el-row>
            <el-col :span="6">
              <el-form-item label="管径" label-width="80px">
                <el-select v-model="formData.gj" placeholder="请选择">
                  <el-option label="DN50" value="DN50" />
                  <el-option label="DN100" value="DN100" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="口径" label-width="80px">
                <el-select v-model="formData.kj" placeholder="请选择">
                  <el-option label="DN50" value="DN50" />
                  <el-option label="DN100" value="DN100" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="管材" label-width="80px">
                <el-select v-model="formData.gc" placeholder="请选择">
                  <el-option label="DN50" value="DN50" />
                  <el-option label="DN100" value="DN100" />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form> -->
			<el-card shadow="never" id="printContent2">
				<!----------------------------------------------------------- 管点资产汇总表 ------------------------->
				<div v-if="queryType == 1">
					<el-table v-loading="loading" :data="tableData" :border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="管点类型" align="center" prop="className" />
						<el-table-column label="管点名称" align="center" prop="pointName" />

						<el-table-column label="管点GIS编号" align="center" prop="pointGisNo" />
						<el-table-column label="坐标位置" align="center" prop="jsonGeom">
							<template #default="scope">
								{{
                  scope.row.jsonGeom
                    ? JSON.parse(scope.row.jsonGeom).coordinates.join(",")
                    : "-"
                }}
							</template>
						</el-table-column>
						<el-table-column label="详细地址" align="center" prop="address" />
						<el-table-column label="埋深（m）" align="center" prop="depth">
							<template #default="scope">
								{{ scope.row.depth ? Number(scope.row.depth).toFixed(2) : "-" }}
							</template>
						</el-table-column>
						<el-table-column label="投运时间" align="center" prop="workStartDate">
							<template #default="scope">
								{{
                  scope.row.workStartDate
                    ? moment(scope.row.workStartDate).format("yyyy-MM-DD")
                    : "-"
                }}
							</template>
						</el-table-column>
					</el-table>
				</div>

				<!----------------------------------------------------------- 管点大类 对应的小类 ------------------------->
				<div v-if="queryType == 2">
					<el-table v-loading="loading" :data="tableData" :border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="管点类型" align="center" prop="className" />
						<el-table-column label="管点名称" align="center" prop="pointName" />

						<el-table-column label="管点GIS编号" align="center" prop="pointGisNo" />
						<el-table-column label="坐标位置" align="center" prop="jsonGeom">
							<template #default="scope">
								{{
                  scope.row.jsonGeom
                    ? JSON.parse(scope.row.jsonGeom).coordinates.join(",")
                    : "-"
                }}
							</template>
						</el-table-column>
						<el-table-column label="详细地址" align="center" prop="address" />
						<el-table-column label="埋深（m）" align="center" prop="depth" />
						<el-table-column label="投运时间" align="center" prop="createTime">
							<template #default="scope">
								{{
                  scope.row.createTime
                    ? moment(scope.row.createTime).format("yyyy-MM-DD")
                    : "-"
                }}
							</template>
						</el-table-column>
						<el-table-column v-for="(item, index) in attrTitleData" :key="index" :prop="'attr' + index"
							width="160" :label="item" align="center" show-overflow-tooltip />
					</el-table>
				</div>

				<!----------------------------------------------------------- 管段资产汇总表 ------------------------->

				<div v-if="queryType == 3">
					<el-table v-loading="loading" :data="tableData" :border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="管段类型" align="center" prop="className" />
						<el-table-column label="管段名称" align="center" prop="lineName" />
						<el-table-column label="管段编号" align="center" prop="lineGisNo" />

						<el-table-column label="起点名称" align="center" prop="startPointName" />
						<el-table-column prop="startPointGisNo" width="160" label="坐标位置" align="center"
							show-overflow-tooltip>
							<template #default="scope">
								{{
			      scope.row.jsonGeom
			        ? JSON.parse(scope.row.jsonGeom).coordinates[0].join(",")
			        : ""
			    }}
							</template>
						</el-table-column>
						<el-table-column label="终点名称" align="center" prop="endPointName" />
						<el-table-column prop="startPointGisNo" width="160" label="坐标位置" align="center"
							show-overflow-tooltip>
							<template #default="scope">
								{{
			      scope.row.jsonGeom
			        ? JSON.parse(scope.row.jsonGeom).coordinates[1].join(",")
			        : ""
			    }}
							</template>
						</el-table-column>
						<el-table-column label="管段长度" align="center" prop="length" />
						<el-table-column label="平均埋深（m）" align="center" prop="depth" />
						<el-table-column label="管径" sortable align="center" prop="diameter" />
						<el-table-column label="口径" sortable align="center" prop="caliber" />
						<el-table-column label="管材" sortable align="center" prop="tubing" />
						<el-table-column label="投运时间" align="center" prop="workStartDate">
							<template #default="scope">
								{{
                  scope.row.workStartDate
                    ? moment(scope.row.workStartDate).format("yyyy-MM-DD")
                    : "-"
                }}
							</template>
						</el-table-column>
					</el-table>
				</div>

				<!----------------------------------------------------------- 高燕管资产清单 ------------------------->
				<div v-if="queryType == 4">
					<el-table v-loading="loading" :data="tableData" :border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="管段GIS编号" align="center" prop="lineGisNo" />
						<el-table-column label="起点名称" align="center" prop="startPointName" />
						<el-table-column prop="startPointGisNo" width="160" label="坐标位置" align="center"
							show-overflow-tooltip>
							<template #default="scope">
								{{
			      scope.row.jsonGeom
			        ? JSON.parse(scope.row.jsonGeom).coordinates[0].join(",")
			        : ""
			    }}
							</template>
						</el-table-column>
						<el-table-column label="终点名称" align="center" prop="endPointName" />
						<el-table-column prop="startPointGisNo" width="160" label="坐标位置" align="center"
							show-overflow-tooltip>
							<template #default="scope">
								{{
			      scope.row.jsonGeom
			        ? JSON.parse(scope.row.jsonGeom).coordinates[1].join(",")
			        : ""
			    }}
							</template>
						</el-table-column>
						<el-table-column label="管段长度" align="center" prop="length" />
						<el-table-column label="平均深度" align="center" prop="depth" />
						<el-table-column label="埋深（m）" align="center" prop="depth" />
						<el-table-column label="投运时间" align="center" prop="createTime">
							<template #default="scope">
								{{
                  scope.row.createTime
                    ? moment(scope.row.createTime).format("yyyy-MM-DD")
                    : "-"
                }}
							</template>
						</el-table-column>
						<el-table-column v-for="(item, index) in attrTitleData" :key="index" :prop="'attr' + index"
							width="160" :label="item" align="center" show-overflow-tooltip />
					</el-table>
				</div>

				<!----------------------------------------------------------- 管网在线监测 ------------------------->
				<div v-if="queryType == 5">
					<el-table v-loading="loading" :data="tableData" :border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="userType">
							<template #default="scope">
								{{ moment(scope.row.createTime).format("yyyy-MM-DD") }}
							</template>
						</el-table-column>
						<el-table-column label="设备类型" align="center" prop="businessType" />
						<el-table-column label="管点名称" align="center" prop="workOrderType" />
						<el-table-column label="管点GIS编号" align="center" prop="meterTypeName" />
						<el-table-column label="详细地址" align="center" prop="meterTypeName" />
						<el-table-column label="数据采集编号" align="center" prop="meterTypeName" />
						<el-table-column label="最近一次上报" align="center" prop="meterTypeName" />
					</el-table>
				</div>

				<!----------------------------------------------------------- 管网异常上报监测 ------------------------->
				<div v-if="queryType == 6">
					<el-table v-loading="loading" :data="tableData" :border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="userType">
							<template #default="scope">
								{{ moment(scope.row.createTime).format("yyyy-MM-DD") }}
							</template>
						</el-table-column>
						<el-table-column label="设备类型" align="center" prop="businessType" />
						<el-table-column label="管点名称" align="center" prop="workOrderType" />
						<el-table-column label="管点GIS编号" align="center" prop="meterTypeName" />
						<el-table-column label="详细地址" align="center" prop="meterTypeName" />
						<el-table-column label="数据采集编号" align="center" prop="meterTypeName" />
						<el-table-column label="第三方报警原因" align="center" prop="meterTypeName" />
						<el-table-column label="最近一次上报" align="center" prop="meterTypeName" />
					</el-table>
				</div>

				<!----------------------------------------------------------- 设备在线监测 ------------------------->
				<div v-if="queryType == 7">
					<el-table v-loading="loading" :data="tableData" :border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="userType">
							<template #default="scope">
								{{ moment(scope.row.createTime).format("yyyy-MM-DD") }}
							</template>
						</el-table-column>
						<el-table-column label="设备类型" align="center" prop="businessType" />
						<el-table-column label="管点名称" align="center" prop="workOrderType" />
						<el-table-column label="管点GIS编号" align="center" prop="meterTypeName" />
						<el-table-column label="详细地址" align="center" prop="meterTypeName" />
						<el-table-column label="数据采集编号" align="center" prop="meterTypeName" />
						<el-table-column label="最近一次上报" align="center" prop="meterTypeName" />
					</el-table>
				</div>
				<!----------------------------------------------------------- 设备异常上报 ------------------------->
				<div v-if="queryType == 8">
					<el-table v-loading="loading" :data="tableData" :border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="userType">
							<template #default="scope">
								{{ moment(scope.row.createTime).format("yyyy-MM-DD") }}
							</template>
						</el-table-column>
						<el-table-column label="设备类型" align="center" prop="businessType" />
						<el-table-column label="管点名称" align="center" prop="workOrderType" />
						<el-table-column label="管点GIS编号" align="center" prop="meterTypeName" />
						<el-table-column label="详细地址" align="center" prop="meterTypeName" />
						<el-table-column label="数据采集编号" align="center" prop="meterTypeName" />
						<el-table-column label="最近一次上报" align="center" prop="meterTypeName" />
					</el-table>
				</div>
				<!----------------------------------------------------------- 今日巡检计划清单 ------------------------->
				<div v-if="queryType == 9">
					<el-table v-loading="loading" :data="tableData" :border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="userType">
							<template #default="scope">
								{{ moment(scope.row.createTime).format("yyyy-MM-DD") }}
							</template> </el-table-column>/>
						<el-table-column label="巡检名称" align="center" prop="planSetName" />
						<el-table-column label="计划类型" align="center" prop="planSetTypeName" />
						<el-table-column label="巡检方向" align="center" prop="taskTypeName" />
						<el-table-column label="线路/区域" align="center" prop="planSetName" />
						<el-table-column label="巡检内容" align="center" prop="taskName" />
						<el-table-column label="巡检部门" align="center" prop="inspDeppartmentName" />
						<el-table-column label="巡检人" align="center" prop="inspUserName">
						</el-table-column>
						<el-table-column label="开始巡检时间" align="center" prop="beginTimeText">
							<template #default="scope">
								{{
                  scope.row.beginTimeText
                    ? moment(scope.row.beginTimeText).format("yyyy-MM-DD HH:mm:ss")
                    : "-"
                }}
							</template>
						</el-table-column>
						<el-table-column label="完成巡检时间" align="center" prop="meterTypeName">
							<template #default="scope">
								{{
                  scope.row.doneTimeText
                    ? moment(scope.row.doneTimeText).format("yyyy-MM-DD HH:mm:ss")
                    : "-"
                }}
							</template>
						</el-table-column>
						<el-table-column label="避开节假日" align="center" prop="isAvoidHoliday">
							<template #default="scope">
								<el-tag v-if="scope.row.isAvoidHoliday" type="success">是</el-tag>

								<el-tag v-else type="warning">否</el-tag>
							</template>
						</el-table-column>
						<el-table-column label="是否完成" align="center" prop="statusText" />
						<el-table-column label="是否存在隐患" align="center" prop="isDanger" />
						<el-table-column label="巡检距离(KM)" align="center" prop="inspLineLengthKM" />
						<el-table-column label="巡检时长" align="center" prop="inspDuration" />
					</el-table>
				</div>

				<!----------------------------------------------------------- 月度巡检计划清单 ------------------------->
				<div v-if="queryType == 10">
					<el-table v-loading="loading" :data="tableData" :border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="userType">
							<template #default="scope">
								{{ moment(scope.row.createTime).format("yyyy-MM-DD") }}
							</template>
						</el-table-column>
						<el-table-column label="巡检名称" align="center" prop="planSetName" />
						<el-table-column label="计划类型" align="center" prop="planSetTypeName" />
						<el-table-column label="巡检方向" align="center" prop="taskTypeName" />
						<el-table-column label="线路/区域" align="center" prop="inspDestName" />
						<el-table-column label="巡检内容" align="center" prop="taskName" />
						<el-table-column label="巡检部门" align="center" prop="inspDeppartmentName" />
						<el-table-column label="巡检人" align="center" prop="inspUserName" />
						<el-table-column label="开始巡检时间" align="center" prop="meterTypeName">
							<template #default="scope">
								{{
                  scope.row.beginTime
                    ? moment(scope.row.beginTime).format("yyyy-MM-DD HH:mm:ss")
                    : "-"
                }}
							</template>
						</el-table-column>
						<el-table-column label="完成巡检时间" align="center" prop="meterTypeName">
							<template #default="scope">
								{{
                  scope.row.doneTime
                    ? moment(scope.row.doneTime).format("yyyy-MM-DD HH:mm:ss")
                    : "-"
                }}
							</template>
						</el-table-column>
						<el-table-column label="避开节假日" align="center" prop="isAvoidHoliday">
							<template #default="scope">
								<el-tag v-if="scope.row.isAvoidHoliday" type="success">是</el-tag>

								<el-tag v-else type="warning">否</el-tag>
							</template>
						</el-table-column>
						<el-table-column label="是否完成" align="center" prop="statusText" />
						<el-table-column label="是否存在隐患" align="center" prop="isDanger" />
						<el-table-column label="巡检距离" align="center" prop="inspLineLength">
							<template #default="scope">
								{{(scope.row.inspLineLength/1000).toFixed(2)}}
							</template>
						</el-table-column>
						<el-table-column label="巡检时长" align="center" prop="inspDuration" />
					</el-table>
				</div>

				<!----------------------------------------------------------- 年度巡检计划清单 ------------------------->
				<div v-if="queryType == 11">
					<div>
						时间:{{queryDate.format("yyyy")}}
					</div>
					<el-table v-loading="loading" :data="tableData" :border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="userType">
							<template #default="scope">
								{{ moment(scope.row.createTime).format("yyyy-MM-DD") }}
							</template>
						</el-table-column>
						<el-table-column label="巡检名称" align="center" prop="planSetName" />
						<el-table-column label="计划类型" align="center" prop="planSetTypeName" />
						<el-table-column label="巡检方向" align="center" prop="taskTypeName" />
						<el-table-column label="线路/区域" align="center" prop="inspDestName" />
						<el-table-column label="巡检内容" align="center" prop="taskName" />
						<el-table-column label="巡检部门" align="center" prop="inspDeppartmentName" />
						<el-table-column label="巡检人" align="center" prop="inspUserName" />
						<el-table-column label="开始巡检时间" align="center" prop="meterTypeName">
							<template #default="scope">
								{{
                  scope.row.beginTime
                    ? moment(scope.row.beginTime).format("yyyy-MM-DD HH:mm:ss")
                    : "-"
                }}
							</template>
						</el-table-column>
						<el-table-column label="完成巡检时间" align="center" prop="meterTypeName">
							<template #default="scope">
								{{
                  scope.row.doneTime
                    ? moment(scope.row.doneTime).format("yyyy-MM-DD HH:mm:ss")
                    : "-"
                }}
							</template>
						</el-table-column>
						<el-table-column label="避开节假日" align="center" prop="isAvoidHoliday">
							<template #default="scope">
								<el-tag v-if="scope.row.isAvoidHoliday" type="success">是</el-tag>

								<el-tag v-else type="warning">否</el-tag>
							</template>
						</el-table-column>
						<el-table-column label="是否完成" align="center" prop="statusText" />
						<el-table-column label="是否存在隐患" align="center" prop="isDanger" />
						<el-table-column label="巡检距离" align="center" prop="inspLineLength">
							<template #default="scope">
								{{(scope.row.inspLineLength/1000).toFixed(2)}}
							</template>
						</el-table-column>
						<el-table-column label="巡检时长" align="center" prop="inspDuration" />
					</el-table>
				</div>

				<!----------------------------------------------------------- 月度巡检计划分析 ------------------------->
				<div v-if="queryType == 12">
					<div>
						时间:{{queryDate.format("yyyy-MM")}}
					</div>
					<el-table v-loading="loading" :data="tableData" :border="true" header-row-class-name="table-header"
						:summary-method="getSummaries13" show-summary>
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="userType">
							<template #default="scope">
								{{ moment(scope.row.createTime).format("yyyy-MM-DD") }}
							</template>
						</el-table-column>
						<el-table-column label="巡检人次" align="center" prop="inspTaskTotal" sortable />
						<el-table-column label="巡检人数" align="center" prop="inspUserTotal" sortable />
						<el-table-column label="巡检点（个）" align="center" prop="positionCount" sortable />
						<el-table-column label="巡检距离（KM）" align="center" prop="inspLineLength" sortable>
							<template #default="scope">
								{{(scope.row.inspLineLength/1000).toFixed(2)}}
							</template>
						</el-table-column>
						<el-table-column label="巡检时长（h)" align="center" prop="inspDuration" sortable>
							<template #default="scope">
								{{ scope.row.inspDuration ? scope.row.inspDuration : 0 }}
							</template>
						</el-table-column>
						<el-table-column label="隐患个数(个)" align="center" prop="dangerTotal" sortable />
						<el-table-column label="处理隐患（个）" align="center" prop="handleDangerTotal" sortable />
					</el-table>
				</div>

				<!----------------------------------------------------------- 年度巡检计划分析 ------------------------->
				<div v-if="queryType == 13">
					<div>
						时间:{{queryDate.format("yyyy")}}
					</div>
					<el-table v-loading="loading" show-summary :data="tableData" :border="true" :summary-method="getSummaries13"
						header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="userType">
							<template #default="scope">
								{{ moment(scope.row.createTime).format("yyyy-MM") }}
							</template>
						</el-table-column>
						<el-table-column label="巡检人次" align="center" prop="inspTaskTotal" />
						<el-table-column label="巡检人数" align="center" prop="inspUserTotal" />
						<el-table-column label="巡检点（个）" align="center" prop="positionCount" />
						<el-table-column label="巡检距离（KM）" align="center" prop="inspLineLength">
							<template #default="scope">
								{{(scope.row.inspLineLength/1000).toFixed(2)}}
							</template>
						</el-table-column>
						<el-table-column label="巡检时长（h)" align="center" prop="inspDuration" />
						<el-table-column label="隐患个数(个)" align="center" prop="dangerTotal" />
						<el-table-column label="处理隐患（个）" align="center" prop="handleDangerTotal" />
					</el-table>
				</div>

				<!----------------------------------------------------------- 巡检人员月度情况分析 ------------------------->
				<div v-if="queryType == 14">
					<div>
						时间:{{queryDate.format("yyyy-MM")}}
					</div>
					<el-table v-loading="loading" show-summary :data="tableData" :border="true" :summary-method="getSummaries13"
						header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="userType" sortable>
							<template #default="scope">
								{{ moment(scope.row.createTime).format("yyyy-MM-DD") }}
							</template>
						</el-table-column>
						<el-table-column label="巡检员" align="center" prop="inspUserName" sortable />
						<el-table-column label="巡检人次" align="center" prop="inspTaskTotal" sortable />
						<el-table-column label="巡检点（个）" align="center" prop="positionCount" sortable />
						<el-table-column label="巡检距离（KM）" align="center" prop="inspLineLength" sortable>
							<template #default="scope">
								{{(scope.row.inspLineLength/1000).toFixed(2)}}
							</template>
						</el-table-column>
						<el-table-column label="巡检时长（h)" align="center" prop="inspDuration" sortable />
						<el-table-column label="隐患个数(个)" align="center" prop="dangerTotal" sortable />
						<el-table-column label="处理隐患（个）" align="center" prop="handleDangerTotal" sortable />
					</el-table>
				</div>

				<!----------------------------------------------------------- 巡检人员年度情况分析 ------------------------->
				<div v-if="queryType == 15">
					<div>
						时间:{{queryDate.format("yyyy")}}
					</div>
					<el-table v-loading="loading" show-summary :data="tableData" :border="true" :summary-method="getSummaries13"
						header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="userType" sortable>
							<template #default="scope">
								{{ moment(scope.row.createTime).format("yyyy-MM") }}
							</template>
						</el-table-column>
						<el-table-column label="巡检员" align="center" prop="inspUserName" sortable />
						<el-table-column label="巡检人次" align="center" prop="inspTaskTotal" sortable />
						<el-table-column label="巡检点（个）" align="center" prop="positionCount" sortable />
						<el-table-column label="巡检距离（KM）" align="center" prop="inspLineLength" sortable>
							<template #default="scope">
								{{(scope.row.inspLineLength/1000).toFixed(2)}}
							</template>
						</el-table-column>
						<el-table-column label="巡检时长（h)" align="center" prop="inspDuration" sortable />
						<el-table-column label="隐患个数(个)" align="center" prop="dangerTotal" sortable />
						<el-table-column label="处理隐患（个）" align="center" prop="handleDangerTotal" sortable />
					</el-table>
				</div>

				<!----------------------------------------------------------- 月度隐患上报清单 ------------------------->
				<div v-if="queryType == 16">
					<div>
						时间:{{queryDate.format("yyyy-MM")}}
					</div>
					<el-table v-loading="loading" :data="tableData" :border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="reportTime">
							<template #default="scope">
								{{ moment(scope.row.reportTime).format("yyyy-MM-DD") }}
							</template>
						</el-table-column>
						<el-table-column label="隐患名称" align="center" prop="dangerName" />
						<el-table-column label="隐患描述" align="center" prop="dangerContent" />
						<el-table-column label="地址" align="center" prop="address" />
						<el-table-column label="隐患等级" align="center" prop="levelText">
							<template #default="scope">
								<el-tag v-if="scope.row.levelText=='高'" type="danger">高</el-tag>
								<el-tag v-if="scope.row.levelText=='中'" type="warning">中</el-tag>
								<el-tag v-if="scope.row.levelText=='低'" type="success">低</el-tag>
							</template>
						</el-table-column>
						<el-table-column label="隐患状态" align="center" prop="statusText" />
						<el-table-column label="上报人员" align="center" prop="creater" />
						<el-table-column label="联系电话" align="center" prop="createrTel" />
						<el-table-column label="发现隐患时间" align="center" prop="reportTime">
							<template #default="scope">
								{{
                  moment(scope.row.reportTime).format("yyyy-MM-DD HH:mm:ss")
                    ? moment(scope.row.reportTime).format("yyyy-MM-DD HH:mm:ss")
                    : "-"
                }}
							</template>
						</el-table-column>
						<el-table-column label="处理隐患时间" align="center" prop="handleTime">
							<template #default="scope">
								{{
                  scope.row.handleTime
                    ? moment(scope.row.handleTime).format("yyyy-MM-DD HH:mm:ss")
                    : "-"
                }}
							</template>
						</el-table-column>
						<el-table-column label="处理时长" align="center" prop="handleDuration">
							<template #default="scope">
								{{ scope.row.handleDurationH }}
							</template>
						</el-table-column>
						<el-table-column label="处理措施" align="center" prop="handleMethod" />
						<el-table-column label="处理人员" align="center" prop="handler" />
						<el-table-column label="联系电话" align="center" prop="handlerTel" />
					</el-table>
				</div>

				<!----------------------------------------------------------- 年度隐患上报清单 ------------------------->
				<div v-if="queryType == 17">
					<div>
						时间:{{queryDate.format("yyyy")}}
					</div>
					<el-table v-loading="loading" :data="tableData" :border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="reportTime">
							<template #default="scope">
								{{ moment(scope.row.reportTime).format("yyyy-MM") }}
							</template>
						</el-table-column>
						<el-table-column label="隐患名称" align="center" prop="dangerName" />
						<el-table-column label="隐患描述" align="center" prop="dangerContent" />
						<el-table-column label="地址" align="center" prop="address" />
						<el-table-column label="隐患等级" align="center" prop="levelText">
							<template #default="scope">
								<el-tag v-if="scope.row.levelText=='高'" type="danger">高</el-tag>
								<el-tag v-if="scope.row.levelText=='中'" type="warning">中</el-tag>
								<el-tag v-if="scope.row.levelText=='低'" type="success">低</el-tag>
							</template>
						</el-table-column>
						<el-table-column label="隐患状态" align="center" prop="statusText" />
						<el-table-column label="上报人员" align="center" prop="creater" />
						<el-table-column label="联系电话" align="center" prop="createrTel" />
						<el-table-column label="发现隐患时间" align="center" prop="reportTime">
							<template #default="scope">
								{{ moment(scope.row.reportTime).format("yyyy-MM-DD HH:mm:ss") }}
							</template>
						</el-table-column>
						<el-table-column label="处理隐患时间" align="center" prop="handleTime">
							<template #default="scope">
								{{
                  scope.row.handleTime
                    ? moment(scope.row.handleTime).format("yyyy-MM-DD HH:mm:ss")
                    : "-"
                }}
							</template>
						</el-table-column>
						<el-table-column label="处理时长" align="center" prop="handleDuration">
							<template #default="scope">
								{{ handleDuration ? handleDuration + "h" : "-" }}
							</template>
						</el-table-column>
						<el-table-column label="处理措施" align="center" prop="handleMethod" />
						<el-table-column label="处理人员" align="center" prop="handler" />
						<el-table-column label="联系电话" align="center" prop="handlerTel" />
					</el-table>
				</div>

				<!----------------------------------------------------------- 月度隐患上报分析 ------------------------->
				<div v-if="queryType == 18">
					<div>
						时间:{{queryDate.format("yyyy-MM")}}
					</div>
					<el-table show-summary :summary-method="getSummaries" v-loading="loading" :data="tableData"
						:border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="createTime" sortable>
							<template #default="scope">
								{{ moment(scope.row.createTime).format("yyyy-MM-DD") }}
							</template>
						</el-table-column>
						<el-table-column label="发现隐患" align="center" prop="dangerTotal" sortable />
						<el-table-column label="已处理隐患" align="center" prop="handleDangerTotal" sortable />
						<el-table-column label="处理中" align="center" prop="todoDangerTotal" sortable />
						<el-table-column label="隐患处理率" align="center" prop="handleDangerRateText" sortable>
							<template #header>
								隐患处理率
								<el-tooltip class="box-item" effect="dark" content="已处理隐患数量与发现隐患数量的比值"
									placement="top-start">
									<el-icon>
										<QuestionFilled />
									</el-icon>
								</el-tooltip>
							</template>
						</el-table-column>
					</el-table>
				</div>

				<!----------------------------------------------------------- 年度隐患上报分析 ------------------------->
				<div v-if="queryType == 19">
					<div>
						时间:{{queryDate.format("yyyy")}}
					</div>
					<el-table show-summary :summary-method="getSummaries" v-loading="loading" :data="tableData"
						:border="true" header-row-class-name="table-header">
						<el-table-column type="index" width="50" align="center" label="序号" />
						<el-table-column label="时间" align="center" prop="createTime" sortable>
							<template #default="scope">
								{{ moment(scope.row.createTime).format("yyyy-MM") }}
							</template>
						</el-table-column>
						<el-table-column label="发现隐患" align="center" prop="dangerTotal" sortable />
						<el-table-column label="已处理隐患" align="center" prop="handleDangerTotal" sortable />
						<el-table-column label="处理中" align="center" prop="todoDangerTotal" sortable />
						<el-table-column label="隐患处理率" align="center" prop="handleDangerRateText" sortable>
							<template #header>
								隐患处理率
								<el-tooltip class="box-item" effect="dark" content="已处理隐患数量与发现隐患数量的比值"
									placement="top-start">
									<el-icon>
										<QuestionFilled />
									</el-icon>
								</el-tooltip>
							</template>
						</el-table-column>
					</el-table>
				</div>

				<div class="mt-[20px] text-[14px]">
					<el-row>
						<el-col :span="12">制表人： {{ userStore.user.nickName }}</el-col>
						<el-col :span="12">制表日期：
							{{ moment(new Date()).format("YYYY-MM-DD HH:mm:ss") }}</el-col>
					</el-row>
				</div>
				<pagination v-if="total > 0" v-model:total="total" v-model:page="queryParams.pageIndex"
					v-model:limit="queryParams.pageSize" @pagination="f_QueryList" />
				<div class="mt-[20px]">
					<b class="float-right ml-[20px]" @click="f_Print"><i-ep-printer style="color: #32bebd" /></b>
					<b style="float: right" @click="f_HandleExport"
						v-if="queryType!=5 && queryType!=6 && queryType!=7 && queryType!=8"><i-ep-download
							style="color: #32bebd" /></b>
				</div>
				<!-- 
      <div v-else>
        <el-empty description="暂无数据" />
      </div> -->
			</el-card>
		</div>
	</div>
</template>
<script setup lang="ts">
	defineOptions({
		name: "Order",
		inheritAttrs: false,
	});
	import { useUserStore } from "@/store";
	import DashboardAPI from "@/api/DashboardAPI";
	import GisLineInfoAPI from "@/api/GisLineInfoAPI";
	import GisPointInfoAPI from "@/api/GisPointInfoAPI";
	import DeviceCategoryApi from "@/api/DeviceCategoryAPI";
	import fileDownload from "js-file-download";
	import moment from "moment";
	import { useRoute } from "vue-router";
	// import { f_GetSearchParams } from "@/utils/common.js";
	const route = useRoute();
	const loading = ref(false);
	const total = ref(0);
	const queryParams = reactive({
		pageIndex: 1,
		pageSize: 10,
	});
	const showqueryType1 = ref(false);
	const showqueryType2 = ref(false);
	const tableData = ref([]);
	const rangDate = ref([]);
	const queryType = ref(1);
	const userStore = useUserStore();
	const queryDate = ref("");
	const queryName = ref("");
	const formData = ref({});
	const classId = ref("");
	const pointData = ref([]);
	const lineData = ref([]);
	const attrTitleData = ref([]);


	function getSummaries(param) {
		const { columns, data } = param;
		const sums = [];
		columns.forEach((column, index) => {
			if (index === 0) {
				sums[index] = '小计';
				return;
			}
			const values = data.map(item => Number(item[column.property]));
			if (column.property === 'todoDangerTotal' || column.property === 'handleDangerTotal' || column.property === 'dangerTotal' || column.property === 'handleDangerRateText') {
				if (!values.every(value => isNaN(value))) {
					sums[index] = values.reduce((prev, curr) => {
						const value = Number(curr);
						if (!isNaN(value)) {
							return prev + curr;
						} else {
							return prev;
						}
					}, 0);
				}
			}
		});
		sums[sums.length - 1] = sums[sums.length - 3] / sums[sums.length - 4]
		sums[sums.length - 1] = (sums[sums.length - 1] * 100).toFixed(2) + '%'
		return sums;
	}
	function getSummaries13(param) {
		const { columns, data } = param;
		const sums = [];
		columns.forEach((column, index) => {
			if (index === 0) {
				sums[index] = '小计';
				return;
			}
			const values = data.map(item => Number(item[column.property]));
			if (!values.every(value => isNaN(value))) {
				sums[index] = values.reduce((prev, curr) => {
					const value = Number(curr);
					if (!isNaN(value)) {
						return prev + curr;
					} else {
						return prev;
					}
				}, 0).toFixed(2);
			}
		});
		sums[5] = (sums[5]/1000).toFixed(2);
		return sums;
	}

	function chageQueryType1() {
		showqueryType1.value = !showqueryType1.value;
	}

	function chageQueryType2() {
		showqueryType2.value = !showqueryType2.value;
	}

	// 查询：管段分组统计信息
	function f_QuryGisLineGroupInfo() {
		let params = {
			pageSize: 10000,
			pageIndex: 1,
			pClassId: "02",
		};
		DashboardAPI.api_query_gis_line_group_info(params).then(({ data }) => {
			if (data && data.length) {
				lineData.value = data;
			}
		});
	}

	// 查询：管点分组统计信息
	function f_QueryGisPointGroupInfo() {
		let params = {
			pageSize: 10000,
			pageIndex: 1,
			pClassId: "01",
		};
		DashboardAPI.api_query_gis_point_group_info(params).then(({ data }) => {
			if (data && data.length) {
				pointData.value = data;
			}
		});
	}

	// 查询
	function f_QueryList1() {
		let params = {
			pageIndex: 1,
			pageSize: 10000,
			isCoordinate: true,
			pClassId: 1,
		};
		GisPointInfoAPI.api_query(params).then(({ data }) => {
			tableData.value = data.items;
		});
	}

	// 查询
	function f_QueryList2() {
		let params = {
			classId: classId.value,
			pageIndex: 1,
			pageSize: 1000,
			isCoordinate: true,
		};
		GisPointInfoAPI.api_query(params).then(({ data }) => {
			tableData.value = data.items;
			attrTitleData.value = [];
			tableData.value.forEach((item, index) => {
				item.pointAttribute.forEach(function (items, indexs) {
					item["attr" + indexs] = items.value;
				});
			});
			data.items[0].pointAttribute.forEach((item) => {
				// if (item.type != 4) {
				attrTitleData.value.push(item.attr);
				// }
			});
		});
	}

	// 查询
	function f_QueryList3() {
		let params = {
			pageIndex: 1,
			pageSize: 10000,
			isCoordinate: true,
			pClassId: 2,
		};
		GisLineInfoAPI.api_query(params).then(({ data }) => {
			tableData.value = data.items;
		});
	}

	// 查询
	function f_QueryList4() {
		let params = {
			classId: classId.value,
			pageIndex: 1,
			pageSize: 1000,
			isCoordinate: true,
		};
		GisLineInfoAPI.api_query(params).then(({ data }) => {
			tableData.value = data.items;
			attrTitleData.value = [];
			tableData.value.forEach((item, index) => {
				item.lineAttribute.forEach(function (items, indexs) {
					item["attr" + indexs] = items.value;
				});
			});
			data.items[0].lineAttribute.forEach((item) => {
				// if (item.type != 4) {
				attrTitleData.value.push(item.attr);
				// }
			});
		});
	}

	// 查询
	function f_QueryList5() {
		let params = {
			Type: 1,
			StartTime: moment(new Date()).format("yyyy-MM-DD 00:00:00"),
			EndTime: moment(new Date()).format("yyyy-MM-DD 23:59:59"),
		};
		DashboardAPI.api_insp_task(params).then(({ data }) => {
			tableData.value = data;
		});
	}

	// 查询
	function f_QueryList6() {
		let params = {
			pageIndex: 1,
			pageSize: 10000,
			StartTime: "2024-01-01",
			EndTime: "2024-12-31",
		};
		DashboardAPI.api_query_by_online_monitor_abnormal_async(params).then(
			({ data }) => {
				tableData.value = data;
			}
		);
	}

	// 查询
	function f_QueryList7() {
		let params = {
			pageIndex: 1,
			pageSize: 10000,
		};
		DashboardAPI.api_query_gis_monitory(params).then(({ data }) => {
			tableData.value = data.items;
		});
	}

	// 查询
	function f_QueryList8() {
		let params = {
			// StartTime: moment(new Date()).format("yyyy-MM-DD 00:00:00"),
			// EndTime: moment(new Date()).format("yyyy-MM-DD 23:59:59"),
			pageIndex: 1,
			pageSize: 10000,
		};
		DashboardAPI.api_query_by_online_monitor_abnormal_async(params).then(
			({ data }) => {
				tableData.value = data;
			}
		);
	}

	// 查询
	function f_QueryList9() {
		let params = {
			Type: 1,
			StartTime: moment(new Date()).format("YYYY-MM-DD") + " 00:00:00",
			EndTime: moment(new Date()).format("YYYY-MM-DD") + " 23:59:59",
		};
		DashboardAPI.api_insp_task(params).then(({ data }) => {
			tableData.value = data;
		});
	}

	// 查询
	function f_QueryList10() {
		let params = {
			Type: 2,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_insp_task(params).then(({ data }) => {
			tableData.value = data;
		});
	}

	// 查询
	function f_QueryList11() {
		let params = {
			Type: 3,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY") +
				"-01-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_insp_task(params).then(({ data }) => {
			tableData.value = data;
		});
	}
	function getLastDayOfMonth(year, month) {
		var nextMonth = new Date(year, month, 1);
		nextMonth.setMonth(nextMonth.getMonth() + 1);
		nextMonth.setDate(0);

		return nextMonth.getDate();
	}

	// 查询
	function f_QueryList12() {
		let params = {
			Type: 2,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_insp_task_analy(params).then(({ data }) => {
			tableData.value = data.details;
		});
	}

	// 查询
	function f_QueryList13() {
		let params = {
			Type: 3,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY") +
				"-01-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_insp_task_analy(params).then(({ data }) => {
			tableData.value = data.details;
		});
	}

	// 查询
	function f_QueryList14() {
		let params = {
			Type: 2,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_insp_user_analy(params).then(({ data }) => {
			tableData.value = data.details;
		});
	}

	// 查询
	function f_QueryList15() {
		let params = {
			Type: 3,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY") +
				"-01-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_insp_user_analy(params).then(({ data }) => {
			tableData.value = data.details;
		});
	}

	// 查询
	function f_QueryList16() {
		let params = {
			Type: 2,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_insp_danger(params).then(({ data }) => {
			tableData.value = data;
		});
	}

	// 查询
	function f_QueryList17() {
		let params = {
			Type: 3,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY") +
				"-01-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_insp_danger(params).then(({ data }) => {
			tableData.value = data;
		});
	}

	// 查询
	function f_QueryList18() {
		let params = {
			Type: 2,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_insp_danger_analy(params).then(({ data }) => {
			tableData.value = data.details;
		});
	}

	// 查询
	function f_QueryList19() {
		let params = {
			Type: 3,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY") +
				"-01-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_insp_danger_analy(params).then(({ data }) => {
			tableData.value = data.details;
		});
	}

	//导出
	function f_HandleExport19() {
		let params = {
			Type: 3,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY") +
				"-01-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_export_insp_danger_analy(params).then((response) => {
			if (response) {
				const aLink = document.createElement("a");
				let blob = new Blob([response], {
					type: "application/vnd.ms-excel",
				});
				aLink.href = URL.createObjectURL(blob);
				aLink.setAttribute(
					"download",
					"年度隐患上报分析" +
					moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
					".xlsx"
				); // 设置下载文件名称
				aLink.click();
				//使用后，需销毁
				URL.revokeObjectURL(aLink.href);
			} else {
				ElMessage({
					showClose: false,
					message: "数据加载失败！",
					type: "error",
				});
			}
		});
	}

	//导出
	function f_HandleExport18() {
		let params = {
			Type: 2,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_export_insp_danger_analy(params).then((response) => {
			if (response) {
				const aLink = document.createElement("a");
				let blob = new Blob([response], {
					type: "application/vnd.ms-excel",
				});
				aLink.href = URL.createObjectURL(blob);
				aLink.setAttribute(
					"download",
					"月度隐患上报分析" +
					moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
					".xlsx"
				); // 设置下载文件名称
				aLink.click();
				//使用后，需销毁
				URL.revokeObjectURL(aLink.href);
			} else {
				ElMessage({
					showClose: false,
					message: "数据加载失败！",
					type: "error",
				});
			}
		});
	}

	//导出   api_export_insp_danger_analy
	function f_HandleExport17() {
		let params = {
			Type: 3,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-01") +
				"-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_export_insp_danger(params).then((response) => {
			if (response) {
				const aLink = document.createElement("a");
				let blob = new Blob([response], {
					type: "application/vnd.ms-excel",
				});
				aLink.href = URL.createObjectURL(blob);
				aLink.setAttribute(
					"download",
					"年度隐患上报清单" +
					moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
					".xlsx"
				); // 设置下载文件名称
				aLink.click();
				//使用后，需销毁
				URL.revokeObjectURL(aLink.href);
			} else {
				ElMessage({
					showClose: false,
					message: "数据加载失败！",
					type: "error",
				});
			}
		});
	}

	//导出
	function f_HandleExport16() {
		let params = {
			Type: 2,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_export_insp_danger(params).then((response) => {
			if (response) {
				const aLink = document.createElement("a");
				let blob = new Blob([response], {
					type: "application/vnd.ms-excel",
				});
				aLink.href = URL.createObjectURL(blob);
				aLink.setAttribute(
					"download",
					"月度隐患上报清单" +
					moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
					".xlsx"
				); // 设置下载文件名称
				aLink.click();
				//使用后，需销毁
				URL.revokeObjectURL(aLink.href);
			} else {
				ElMessage({
					showClose: false,
					message: "数据加载失败！",
					type: "error",
				});
			}
		});
	}

	//导出
	function f_HandleExport15() {
		let params = {
			Type: 3,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY") +
				"-01-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_export_insp_user_analy(params).then((response) => {
			if (response) {
				const aLink = document.createElement("a");
				let blob = new Blob([response], {
					type: "application/vnd.ms-excel",
				});
				aLink.href = URL.createObjectURL(blob);
				aLink.setAttribute(
					"download",
					"巡检人员年度情况分析" +
					moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
					".xlsx"
				); // 设置下载文件名称
				aLink.click();
				//使用后，需销毁
				URL.revokeObjectURL(aLink.href);
			} else {
				ElMessage({
					showClose: false,
					message: "数据加载失败！",
					type: "error",
				});
			}
		});
	}

	//导出
	function f_HandleExport14() {
		let params = {
			Type: 2,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_export_insp_user_analy(params).then((response) => {
			if (response) {
				const aLink = document.createElement("a");
				let blob = new Blob([response], {
					type: "application/vnd.ms-excel",
				});
				aLink.href = URL.createObjectURL(blob);
				aLink.setAttribute(
					"download",
					"巡检人员月度情况分析" +
					moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
					".xlsx"
				); // 设置下载文件名称
				aLink.click();
				//使用后，需销毁
				URL.revokeObjectURL(aLink.href);
			} else {
				ElMessage({
					showClose: false,
					message: "数据加载失败！",
					type: "error",
				});
			}
		});
	}

	//导出
	function f_HandleExport13() {
		let params = {
			Type: 3,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY") +
				"-01-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_export_insp_task_analy(params).then((response) => {
			if (response) {
				const aLink = document.createElement("a");
				let blob = new Blob([response], {
					type: "application/vnd.ms-excel",
				});
				aLink.href = URL.createObjectURL(blob);
				aLink.setAttribute(
					"download",
					"年度巡检计划分析" +
					moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
					".xlsx"
				); // 设置下载文件名称
				aLink.click();
				//使用后，需销毁
				URL.revokeObjectURL(aLink.href);
			} else {
				ElMessage({
					showClose: false,
					message: "数据加载失败！",
					type: "error",
				});
			}
		});
	}

	//导出  api_export_insp_danger_analy
	function f_HandleExport12() {
		let params = {
			Type: 2,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};

		DashboardAPI.api_export_insp_task_analy(params).then((response) => {
			if (response) {
				const aLink = document.createElement("a");
				let blob = new Blob([response], {
					type: "application/vnd.ms-excel",
				});
				aLink.href = URL.createObjectURL(blob);
				aLink.setAttribute(
					"download",
					"月度巡检计划分析" +
					moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
					".xlsx"
				); // 设置下载文件名称
				aLink.click();
				//使用后，需销毁
				URL.revokeObjectURL(aLink.href);
			} else {
				ElMessage({
					showClose: false,
					message: "数据加载失败！",
					type: "error",
				});
			}
		});
	}

	//导出
	function f_HandleExport11() {
		let params = {
			Type: 3,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY") +
				"-01-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_export_insp_task(params).then((res : any) => {
			fileDownload(
				res,
				"年度巡检计划清单" +
				moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
				".xlsx"
			);
		});
		// DashboardAPI.api_export_insp_task(params).then((response) => {
		// 	if (response) {
		// 		const aLink = document.createElement("a");
		// 		let blob = new Blob([response], {
		// 			type: "application/vnd.ms-excel",
		// 		});
		// 		aLink.href = URL.createObjectURL(blob);
		// 		aLink.setAttribute(
		// 			"download",
		// 			"年度巡检计划清单" +
		// 			moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
		// 			".xlsx"
		// 		); // 设置下载文件名称
		// 		aLink.click();
		// 		//使用后，需销毁
		// 		URL.revokeObjectURL(aLink.href);
		// 	} else {
		// 		ElMessage({
		// 			showClose: false,
		// 			message: "数据加载失败！",
		// 			type: "error",
		// 		});
		// 	}
		// });
	}

	//导出
	function f_HandleExport10() {
		let params = {
			Type: 2,
			StartTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-01 00:00:00",
			EndTime:
				moment(queryDate.value ? queryDate.value : new Date()).format("YYYY-MM") +
				"-" +
				getLastDayOfMonth(
					new Date(queryDate.value).getFullYear(),
					new Date(queryDate.value).getMonth()
				) +
				" 23:59:59",
		};
		DashboardAPI.api_export_insp_task(params).then((response) => {
			if (response) {
				const aLink = document.createElement("a");
				let blob = new Blob([response], {
					type: "application/vnd.ms-excel",
				});
				aLink.href = URL.createObjectURL(blob);
				aLink.setAttribute(
					"download",
					"月度巡检计划清单" +
					moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
					".xlsx"
				); // 设置下载文件名称
				aLink.click();
				//使用后，需销毁
				URL.revokeObjectURL(aLink.href);
			} else {
				ElMessage({
					showClose: false,
					message: "数据加载失败！",
					type: "error",
				});
			}
		});
	}

	//导出
	function f_HandleExport9() {
		let params = {
			Type: 1,
			StartTime: moment(new Date()).format("YYYY-MM-DD") + " 00:00:00",
			EndTime: moment(new Date()).format("YYYY-MM-DD") + " 23:59:59",
		};
		DashboardAPI.api_export_insp_task(params).then((response) => {
			if (response) {
				const aLink = document.createElement("a");
				let blob = new Blob([response], {
					type: "application/vnd.ms-excel",
				});
				aLink.href = URL.createObjectURL(blob);
				aLink.setAttribute(
					"download",
					"今日巡检计划清单" +
					moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
					".xlsx"
				); // 设置下载文件名称
				aLink.click();
				//使用后，需销毁
				URL.revokeObjectURL(aLink.href);
			} else {
				ElMessage({
					showClose: false,
					message: "数据加载失败！",
					type: "error",
				});
			}
		});
	}

	//导出
	function f_HandleExport8() {
		let params = {
			// StartTime: "2024-01-01 00:00:00",
			// EndTime: "2024-12-31 23:59:59",
			pageIndex: 1,
			pageSize: 10000,
		};
		DashboardAPI.api_export_by_online_monitor_abnormal_async(params).then(
			(response) => {
				if (response) {
					const aLink = document.createElement("a");
					let blob = new Blob([response], {
						type: "application/vnd.ms-excel",
					});
					aLink.href = URL.createObjectURL(blob);
					aLink.setAttribute(
						"download",
						"设备异常上报" +
						moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
						".xlsx"
					); // 设置下载文件名称
					aLink.click();
					//使用后，需销毁
					URL.revokeObjectURL(aLink.href);
				} else {
					ElMessage({
						showClose: false,
						message: "数据加载失败！",
						type: "error",
					});
				}
			}
		);
	}

	//导出
	function f_HandleExport7() {
		let params = {
			Type: 3,
			StartTime: "2024-01-01 00:00:00",
			EndTime: "2024-12-31 23:59:59",
		};
		DashboardAPI.api_export_insp_danger_analy(params).then((response) => {
			if (response) {
				const aLink = document.createElement("a");
				let blob = new Blob([response], {
					type: "application/vnd.ms-excel",
				});
				aLink.href = URL.createObjectURL(blob);
				aLink.setAttribute(
					"download",
					"设备在线监测" +
					moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
					".xlsx"
				); // 设置下载文件名称
				aLink.click();
				//使用后，需销毁
				URL.revokeObjectURL(aLink.href);
			} else {
				ElMessage({
					showClose: false,
					message: "数据加载失败！",
					type: "error",
				});
			}
		});
	}

	//导出
	function f_HandleExport6() {
		let params = {
			// StartTime: "2024-01-01 00:00:00",
			// EndTime: "2024-12-31 23:59:59",
			pageIndex: 1,
			pageSize: 10000,
		};
		DashboardAPI.api_export_by_online_monitor_abnormal_async(params).then(
			(response) => {
				if (response) {
					const aLink = document.createElement("a");
					let blob = new Blob([response], {
						type: "application/vnd.ms-excel",
					});
					aLink.href = URL.createObjectURL(blob);
					aLink.setAttribute(
						"download",
						"管网异常数据监测" +
						moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
						".xlsx"
					); // 设置下载文件名称
					aLink.click();
					//使用后，需销毁
					URL.revokeObjectURL(aLink.href);
				} else {
					ElMessage({
						showClose: false,
						message: "数据加载失败！",
						type: "error",
					});
				}
			}
		);
	}

	//导出
	function f_HandleExport5() {
		let params = {
			Type: 3,
			pageIndex: 1,
			pageSize: 10000,
			StartTime: "2024-01-01 00:00:00",
			EndTime: "2024-12-31 23:59:59",
			isReport: true,
		};
		DashboardAPI.api_export_gis_monitory(params).then((res : any) => {
			fileDownload(
				res.data,
				"管网在线监测" +
				moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
				".xlsx"
			);
		});
	}

	//导出
	function f_HandleExport4() {
		let params = {
			classId: classId.value,
			pageIndex: 1,
			pageSize: 10000,
			isReport: true,
		};
		DashboardAPI.api_query_Lineclassid_export(params).then((res : any) => {
			fileDownload(
				res.data,
				queryName.value +
				moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
				".xlsx"
			);
			// if (response) {
			//   const aLink = document.createElement("a");
			//   let blob = new Blob([response], {
			//     type: "application/vnd.ms-excel",
			//   });
			//   aLink.href = URL.createObjectURL(blob);
			//   aLink.setAttribute(
			//     "download",
			//     queryName.value +
			//       moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
			//       ".xlsx"
			//   ); // 设置下载文件名称
			//   aLink.click();
			//   //使用后，需销毁
			//   URL.revokeObjectURL(aLink.href);
			// } else {
			//   ElMessage({
			//     showClose: false,
			//     message: "数据加载失败！",
			//     type: "error",
			//   });
			// }
		});
		// DashboardAPI.api_export_insp_danger_analy(params).then((response) => {
		//   if (response) {
		//     const aLink = document.createElement("a");
		//     let blob = new Blob([response], {
		//       type: "application/vnd.ms-excel",
		//     });
		//     aLink.href = URL.createObjectURL(blob);
		//     aLink.setAttribute(
		//       "download",
		//       queryName.value+
		//         moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
		//         ".xlsx"
		//     ); // 设置下载文件名称
		//     aLink.click();
		//     //使用后，需销毁
		//     URL.revokeObjectURL(aLink.href);
		//   } else {
		//     ElMessage({
		//       showClose: false,
		//       message: "数据加载失败！",
		//       type: "error",
		//     });
		//   }
		// });
	}

	//导出
	function f_HandleExport3() {
		let params = {
			// StartTime: "2024-01-01 00:00:00",
			// EndTime: "2024-12-31 23:59:59",
			pageIndex: 1,
			pageSize: 10000,
			isReport: true,
		};
		GisLineInfoAPI.api_export_query_async_(params).then((res : any) => {
			fileDownload(
				res.data,
				"管段资产汇总表" +
				moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
				".xlsx"
			);
		});
		// DashboardAPI.api_export_line_info_async(params).then((response) => {
		//   if (response) {
		//     const aLink = document.createElement("a");
		//     let blob = new Blob([response], {
		//       type: "application/vnd.ms-excel",
		//     });
		//     aLink.href = URL.createObjectURL(blob);
		//     aLink.setAttribute(
		//       "download",
		//       "管段资产汇总表" +
		//         moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
		//         ".xlsx"
		//     ); // 设置下载文件名称
		//     aLink.click();
		//     //使用后，需销毁
		//     URL.revokeObjectURL(aLink.href);
		//   } else {
		//     ElMessage({
		//       showClose: false,
		//       message: "数据加载失败！",
		//       type: "error",
		//     });
		//   }
		// });
	}

	//导出
	function f_HandleExport2() {
		let params = {
			classId: classId.value,
			pageIndex: 1,
			pageSize: 10000,
			isReport: true,
		};

		// GisPointInfoAPI.api_export_query_async(params).then((res: any) => {
		//   fileDownload(
		//     res.data,
		//     queryName.value +
		//       moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
		//       ".xlsx"
		//   );
		// });
		DashboardAPI.api_query_Pointclassid_export(params).then((res : any) => {
			fileDownload(
				res.data,
				queryName.value +
				moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
				".xlsx"
			);
			// if (response) {
			//   const aLink = document.createElement("a");
			//   let blob = new Blob([response], {
			//     type: "application/vnd.ms-excel",
			//   });
			//   aLink.href = URL.createObjectURL(blob);
			//   aLink.setAttribute(
			//     "download",
			//     queryName.value +
			//       moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
			//       ".xlsx"
			//   ); // 设置下载文件名称
			//   aLink.click();
			//   //使用后，需销毁
			//   URL.revokeObjectURL(aLink.href);
			// } else {
			//   ElMessage({
			//     showClose: false,
			//     message: "数据加载失败！",
			//     type: "error",
			//   });
			// }
		});
	}

	//导出
	function f_HandleExport1() {
		let params = {
			pageIndex: 1,
			pageSize: 10000,
			isReport: true,
		};
		// GisLineInfoAPI.api_export_query_async_(params).then((res: any) => {
		//   fileDownload(
		//     res.data,
		//     "管点资产汇总表" +
		//       moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
		//       ".xlsx"
		//   );
		// });
		DashboardAPI.api_query_jsongeomasync_export(params).then((res : any) => {
			fileDownload(
				res.data,
				"管点资产汇总表" +
				moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
				".xlsx"
			);
			// if (response) {
			//   const aLink = document.createElement("a");
			//   let blob = new Blob([response], {
			//     type: "application/vnd.ms-excel",
			//   });
			//   aLink.href = URL.createObjectURL(blob);
			//   aLink.setAttribute(
			//     "download",
			//     "管点资产汇总表" +
			//       moment(new Date()).format("YYYY年MM月DD日HH时mm分ss秒") +
			//       ".xlsx"
			//   ); // 设置下载文件名称
			//   aLink.click();
			//   //使用后，需销毁
			//   URL.revokeObjectURL(aLink.href);
			// } else {
			//   ElMessage({
			//     showClose: false,
			//     message: "数据加载失败！",
			//     type: "error",
			//   });
			// }
		});
	}
	function f_Print() {
		// 获取需要打印的内容
		let cardBodyContent =
			document.getElementsByClassName("printContent")[0].innerHTML;

		// 排除需要忽略的内容
		// let formContent = document.getElementsByClassName('layui-form');
		// if (formContent.length > 0) {
		//   let formInnerHtml = formContent[0].innerHTML;
		//   cardBodyContent = cardBodyContent.replace(formInnerHtml, '');
		// }

		// 将需要打印的内容设置为 body 的新内容
		document.body.innerHTML = cardBodyContent;

		// 执行打印
		window.print();

		// 刷新页面
		location.reload();
	}
	function changeTypeQuery(e, name, id) {
		queryType.value = e;
		if (name) {
			queryName.value = name;
		}
		if (id) {
			classId.value = id;
		}

		f_HandleQuery();
	}
	// 查询
	function f_HandleQuery() {
		switch (Number(queryType.value)) {
			case 19:
				f_QueryList19();
				break;
			case 18:
				f_QueryList18();
				break;
			case 17:
				f_QueryList17();
				break;
			case 16:
				f_QueryList16();
				break;
			case 15:
				f_QueryList15();
				break;
			case 14:
				f_QueryList14();
				break;
			case 13:
				f_QueryList13();
				break;
			case 12:
				f_QueryList12();
				break;
			case 11:
				f_QueryList11();
				break;
			case 10:
				f_QueryList10();
				break;
			case 9:
				f_QueryList9();
				break;
			case 8:
				f_QueryList8();
				break;
			case 7:
				f_QueryList7();
				break;
			case 6:
				f_QueryList6();
				break;
			case 5:
				f_QueryList5();
				break;
			case 4:
				f_QueryList4();
				break;
			case 3:
				f_QueryList3();
				break;
			case 2:
				f_QueryList2();
				break;
			case 1:
				f_QueryList1();
				break;
		}
	}

	// 导出
	function f_HandleExport() {
		switch (Number(queryType.value)) {
			case 19:
				f_HandleExport19();
				break;
			case 18:
				f_HandleExport18();
				break;
			case 17:
				f_HandleExport17();
				break;
			case 16:
				f_HandleExport16();
				break;
			case 15:
				f_HandleExport15();
				break;
			case 14:
				f_HandleExport14();
				break;
			case 13:
				f_HandleExport13();
				break;
			case 12:
				f_HandleExport12();
				break;
			case 11:
				f_HandleExport11();
				break;
			case 10:
				f_HandleExport10();
				break;
			case 9:
				f_HandleExport9();
				break;
			case 8:
				f_HandleExport8();
				break;
			case 7:
				f_HandleExport7();
				break;
			case 6:
				f_HandleExport6();
				break;
			case 5:
				f_HandleExport5();
				break;
			case 4:
				f_HandleExport4();
				break;
			case 3:
				f_HandleExport3();
				break;
			case 2:
				f_HandleExport2();
				break;
			case 1:
				f_HandleExport1();
				break;
		}
	}
	onMounted(() => {
		queryType.value = Number(route.query.type);
		queryDate.value = moment(route.query.time);
		queryName.value = route.query.name;
		classId.value = route.query.id;
		f_HandleQuery();
		f_QueryGisPointGroupInfo();
		f_QuryGisLineGroupInfo();
	});
</script>
<style lang="scss" scoped>
	.app-container {
		width: 1400px;
		padding: 50px 15px;
		margin: 0 auto;
		height: calc(100vh) !important;
	}

	.el-card,
	:deep .el-card__body {
		border: none;
	}

	.el-card:first-child {
		height: auto;
		margin-bottom: 10px;

		:deep .el-card__body {
			height: auto;
		}
	}

	.el-empty:last-child {
		height: calc(100vh - 256px);
	}

	.search-container {
		position: relative;
		height: 50px;
		font-family: cursive;
		font-size: 32px;
		font-weight: bold;
		text-align: center;
		border: none;
		box-shadow: none;

		img {
			position: absolute;
			top: 0;
			left: 20px;
			width: auto;
			height: 40px;
		}
	}

	:deep .pagination .el-pagination {
		float: left;
	}
</style>
<style media="print">
	@page {
		size: auto;
		/* auto is the initial value */
		margin: 0;
		/* this affects the margin in the printer settings */
	}
</style>